home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / YICN23.ZIP / DOC / FAQ.DOC next >
Text File  |  1993-03-06  |  14KB  |  389 lines

  1. Some questions and a few answers on YakIcons concepts:
  2.  
  3.  
  4.  
  5. What is Xmode?
  6.  
  7. Xmode is a tweaked mode of the VGA display card that displays the screen in
  8. planar form instead of a single array of memory.  It was "discovered" and
  9. discussed in Mike Abrash's column in Dr. Dobb's journal, and has become
  10. the focus of much discussion, particularly among game programmers.  See Dr.
  11. Dobb's journal issues 178-179.  X mode allows planar addressing of the VGA,
  12. allowing processing of pixels in parallel, increasing puts from memory to
  13. screen almost fourfold.  It also allows multiple pages in video memory,
  14. making double-buffering much easier.
  15.  
  16.  
  17. Okay.  What the heck is double-buffering?
  18.  
  19. Double-buffering is a technique where one page is written to in "hidden"
  20. (off-screen) memory and then the display card is told to look at that memory
  21. (make it visible).  This allows all of the changes to a screen to be displayed
  22. at once, without the user being able to see the changes individually.  While
  23. the new page is being shown, the old one is written to, and the pages flip
  24. back and forth.
  25.  
  26.  
  27. I thought that was just called "page-flipping."
  28.  
  29. It was.  The technique has been around a bit (I first saw it on an apple II+,
  30. and it was around before then, I'm sure), and for the most part was used to
  31. animate graphics on machines where the screen was exactly the size of the
  32. screen memory.  Now, though, video display cards can address memory that is
  33. much larger than the screen size, and with different display modes, video
  34. memory can have different-sized "pages" depending on mode, size of virtual
  35. screen, etc.  So instead of calling the blocks "pages," people refer to them
  36. as "buffers"-- just amorphous hunks of memory the card can address.  If enough
  37. memory is available, triple, quadruple, or higher buffering is possible.
  38.  
  39.  
  40. What's the point?  People can only use one page at a time.
  41.  
  42. Agreed; for most animation concepts, two pages is plenty.  Uses for a third
  43. page in video memory include a movable split screen (for scores, etc),  storage
  44. in video memory of sprites...
  45.  
  46.  
  47. What's a sprite?
  48.  
  49. A sprite is an object that is put on the graphics screen.  People tend to use
  50. the term for most any object on the screen, but really the term "sprite"
  51. refers to an object that doesn't disturb the background.
  52.  
  53.  
  54. Wait.  If you put it in video memory, it HAS to disturb the background.
  55.  
  56. True, to a point, but there are sometimes hardware alternatives which can
  57. display a background page and then "layer" hardware sprites over it.  Most
  58. arcade games do this.  Also, you can use that third page in memory for a
  59. static background page that can be copied onto where the sprite was, thus
  60. effectively "erasing" it.
  61.  
  62.  
  63. So why not use standard memory?  It's cheap nowadays.
  64.  
  65. It's cheap, but it's not fast for this.  The reason?  The video display card
  66. can only look at video ram.  To transfer the data from standard memory
  67. to video memory, the computer has to go through the interface with the card.
  68. 16-bit interfaces are pretty standard, and that's slow compared to the
  69. 32-bit motherboards we have today and also slow compared to the quick memory
  70. transfers on board most display cards.
  71.  
  72.  
  73. Why not keep all image data in the display card?
  74.  
  75. There's not enough room.
  76.  
  77.  
  78. Why don't vga manufacturers put more memory on their cards?
  79.  
  80. Video ram costs more, and not everyone uses their PC for games.
  81.  
  82.  
  83. Why not?
  84.  
  85. No idea.
  86.  
  87.  
  88. How come even though I'm a great programmer, my graphics look terrible?
  89.  
  90. Lack of artistic talent, probably.  Mine look pretty bad too.  It's tough to
  91. make pixels look like anything good unless you're a skilled computer artist.
  92.  
  93.  
  94. A friend of mine tried to help me out; he draws fantastically, but he can't
  95. do a thing with the computer.  What can he do to get better?
  96.  
  97. Well, there are some tricks to computer art, especially art in a restricted
  98. mode like 320*200 which has fairly large pixels.  Most people underestimate
  99. the power of a single dot.  One misplaced pixel can make a small sprite look
  100. terrible.  EVERY dot is important, and unless you're willing to hunker down
  101. and decide what each dot should do, it'll look stiff, square, and cartoonish.
  102.  
  103.  
  104. Good enough.  But now everything's blocky.
  105.  
  106. Ah, the joy of dithering!  With 256 colors, there's no reason at all that
  107. color fades can't be smooth and elegant.  This can be used to our advantage;
  108. in the Psygnosis game Blood Money, there were quite a few stalactites that
  109. seemed very pointy, even though they stayed the same width (one pixel) most
  110. of their length.  The reason?  The color faded slowly from white to dark blue,
  111. and the effect was that the stalactite got thinner.  This can be used on
  112. curved surfaces, where the "stairstep" effect can be very detrimental.  If,
  113. for example, you have a circle
  114.  
  115.      **
  116.     ****
  117.     ****
  118.      **
  119.  
  120. Looks pretty blocky, right?  Now take a darker shade of that color and fill
  121. in the corners.
  122.  
  123.     .**.
  124.     ****
  125.     ****
  126.     .**.
  127.  
  128. Here, it looks even more square.  On the graphics screen, though, this makes
  129. the circle look a good deal more circular, because our eyes see the dithered
  130. corners as more rounded edges.  Make sure you use the most full range of colors
  131. that you possibly can!
  132.  
  133.  
  134. Um... looks good on a black screen, but now my sprites vanish when I put them
  135. on my background.
  136.  
  137. Encase everything in a thin layer of black.  This can also help to eliminate
  138. blockiness.  Suppose you have a square:
  139.  
  140.    **
  141.    **
  142.  
  143. Outline it in black, but don't fill in the corners...
  144.  
  145.    ..
  146.   .**.
  147.   .**.
  148.    ..
  149.  
  150. Looks much better, and shows up on backgrounds!  Look at Ultima 7 for a good
  151. example of outlining.  You may also want to take up miniature painting; a
  152. good deal of the tactics are similar.
  153.  
  154.  
  155.  
  156. Nice so far.  But the actual workings of YakIcons are a little beyond me.
  157.  
  158. You're probably trying to read more into it than you need to.  Implementation
  159. of Yakicons is not that tough.  The best thing to do is get into the sample
  160. programs.  Play with them.  Tweak them.  They're yours, after all!
  161.  
  162.  
  163. What's so great about an animslave?  Why can't we just have animicons?
  164.  
  165. Animslaves POINT at animicons, so they work just as well without taking up
  166. all the space.  Of course, you have to have one copy of the real icon for
  167. the animslaves to look at.
  168.  
  169.  
  170. Won't all the animslaves be in sync then?
  171.  
  172. No, not necessarily.  An animslave can advance (look at a different frame of
  173. the animicon) without the original icon or any other slave knowing about it.
  174. It's quite possible to have many animslaves all showing different frames
  175. while slaving off the same icon.  Best of all, they don't take much memory
  176. at all!
  177.  
  178.  
  179. Do they mind being slaves?
  180.  
  181. No.
  182.  
  183.  
  184. Why the static variables like iconTable, eventTable, ficonTable, and
  185. feventTable?
  186.  
  187. Static variables are accessible from all members of the class.  These tables
  188. are used to hold the icons that the actors slave off of.
  189.  
  190.  
  191. Why not have just one big table for all the classes to slave off of?
  192.  
  193. So you can separate them all.  This way, you can load all the events (spells,
  194. explosions, whatever) into event_table and all your regular actors (tanks,
  195. priests, whatever) into icon_table.  Or the faced-versions of both.
  196.  
  197.  
  198. Why does animactor have a turn function that does nothing?
  199.  
  200. It needed to be included in the virtual function call table for animactor,
  201. because when factors spawn something, they "turn()" it to the same direction
  202. they're facing.  But I wanted factors to be able to spawn animactors, so
  203. I had to include the turn() function in animactor too.
  204.  
  205.  
  206. What's spawning good for?
  207.  
  208. Good question.  Usually, you'll use actors for the "usual" animations of
  209. someone or something.  But if your boodlino slashes a grumjug, you don't
  210. want to show the boodle doing his usual thing, you want him to slash with his
  211. sword.  However, removing the boodlino and replacing him with a different actor
  212. (the slasher) is clumsy.  So spawn the slashing-boodle event, and he'll be
  213. drawn doing that instead.  It's easy once you figure it out.
  214.  
  215.  
  216. What are events good for?
  217.  
  218. Events are unique in that they remove themselves once they're done playing.
  219. This allows us to put explosions, fires, whatever on a map and forget about
  220. them, since they clean up after themselves.
  221.  
  222.  
  223. So if I spawn an event, the program will go back to drawing the original
  224. actor after the event is over?
  225.  
  226. Yep.
  227.  
  228.  
  229. How do scripts work?
  230.  
  231. Well, that's a little iffy.  They're not well developed yet, but they're doing
  232. okay.  Basically, once you add a line to an actor, it starts going, executing
  233. each line and deleting it as it goes along.  It's best to move actors using
  234. script lines; they take care of themselves pretty well.
  235.  
  236.  
  237. Okay, this is pretty much the same as it was during your last release.
  238. what's new?
  239.  
  240. Almost everything.  Be more specific!
  241.  
  242.  
  243. Why the new format change, causing your programmers to have to search and
  244. replace half their function names?
  245.  
  246. I didn't like the underscores, and was starting to program in a different
  247. style (the "mixed case").  To avoid mixing styles, I reformatted everything.
  248. It won't happen again-- promise!
  249.  
  250.  
  251. What's a yakLib?
  252.  
  253. It's an archive format similar to a .zip or .arj.  I needed a way to put all
  254. the data a program could need into one file.  DId you notice all the millions
  255. of ".drw" files were gone?
  256.  
  257.  
  258. Actually, I had.  I LIKED the .drw files; they were smaller than .yaks.  Why
  259. did you change?
  260.  
  261. Ease of use, mostly.  I wanted a file format more compatible with x mode, so
  262. I didn't have to convert every time I loaded.  The .yaks do compress a lot
  263. more, though, when crunched with a zip'er or arj'er.  Hadn't you noticed?
  264.  
  265.  
  266. I keep getting undefined errors in linking.  What's up?
  267.  
  268. Make sure you're in the large memory module and are inlcuding every .obj
  269. file you need!  This can be hairy.  look at the example projects.
  270.  
  271.  
  272. This gadget thing is really losing me.
  273.  
  274. Keep trying.  Look at the demo programs--I can't explain them any better.
  275. The best way to learn this stuff is just by doing it.
  276.  
  277.  
  278. When I use page flipping, the mouse vanishes just like it does in animap.exe.
  279. What gives?
  280.  
  281. The page flipping is confusing your poor little rodent.  You'll have to
  282. physically draw the mouse cursor on every page if you want it there.
  283.  
  284.  
  285.  
  286.  
  287. I'm still lost.
  288.  
  289. Look at the examples.
  290.  
  291.  
  292. What if I'm still lost after that?
  293.  
  294. write me.  I'm serious.  I WILL get back to you or address your problem in
  295. an issue of the mooYaks newsletter.
  296.  
  297.  
  298. The WHAT?
  299.  
  300. The mooYaks newsletter.  I'll be putting it out periodically after I have
  301. a list of people to send it to.  So give me your address.  It's free!
  302.  
  303.  
  304. What are YOU doing with yakIcons?
  305.  
  306. That's not as important as what YOU are doing, but if you must know, I have
  307. three major projects on-line:
  308. Morningstar: Cybergenic mechanized combat.  Better than Battletech!
  309. Coverdale: Roleplaying in a rich fantasy world.  Should be GREAT.
  310. Shadow of the Beet: I'm not really oriented to action games, but I want to
  311.                     see if I can write one.
  312.  
  313.  
  314.  
  315. What's upcoming in future releases of YakIcons?
  316.  
  317. Well, a rewrite of the icons class is in order so it can handle different
  318. types of files than ".yak" and ".drw" files.  Windows .BMP's and .GIF's are a
  319. possibility. There are also a few more animaps I need to design.
  320. Hex maps would be pretty easy, but my next big project is an isomap, like the
  321. displays on Populous or Four Crystals of the Trazere.
  322. I'd also like the maps to save the actors within them! (also shouldn't be
  323. too terribly hard if each actor knows how to save itself).
  324. FM instruments for the Soundblaster coming soon, along with music!  Also, the
  325. zooming routines will allow for differential zooming-- ie viewing icons at
  326. an angle.  You can see the yakMaze 3-d scrolling object coming, can't you?
  327.  
  328.  
  329. Why "Yak"?
  330.  
  331. Gnu was already taken.
  332.  
  333.  
  334. That's a joke, right?
  335.  
  336. Not really; GNU C is a great public-domain compiler, and I thought: hey, if
  337. they can do that, I can sure as heck put out a free game programming library.
  338.  
  339.  
  340. Can I modify YakIcons?
  341.  
  342. As long as you don't distribute it afterwards, sure.  If you come up with
  343. something really cool, let me know!  I will be VERY busy in the coming year,
  344. and while I expect yakIcons to be updated, I expect the updates to originate
  345. from you, the users.  I NEED speed; I've tried a few different methods to
  346. make animaps faster, but so far it's been inconclusive.  If you have any
  347. ideas, let me know!
  348.  
  349.  
  350.  
  351. Can I use YakIcons in my own programs?
  352.  
  353. If I didn't want people to use it, I wouldn't have distributed it!
  354.  
  355.  
  356. Wait a sec.  Is there a catch?
  357.  
  358. No, not really.  Use YakIcons all you want.  I got really tired of people
  359. requesting $60 or $80 for graphics packages when most shareware games don't
  360. make all that much.  However: if you do break dollar one, it'd be a real
  361. treat if you'd lob a share my way.  Whatever percentage of your product you
  362. think YakIcons helped with, send that percentage of your first $1000.
  363. (ie if you make $10 off one nice guy the whole time, just give me $2).  You
  364. don't have to do this at all-- YakIcons IS shareware, but it's free-- but it'd
  365. make me a lot more inclined to give out future releases without registration.
  366. Give me what you think I deserve.  20% seems about right, I guess, since
  367. everyone I've talked to about shareware games has gotten about $100 total,
  368. and YakIcons does make development a lot faster (Boodles took me a week of
  369. spare time, including graphics drawing, without considering fine-tuning Yak)
  370. Twenty bucks isn't much... especially if you make $80 out of the deal.
  371. And I don't think it's fair that I should make anything if you don't.  If
  372. you're not getting bread for your game, don't send me any.  But I would
  373. appreciate if you'd
  374.  
  375. 1) Put some sort of notification in your program that you used YakIcons
  376. 2) Let me know that you've made something with it!
  377.  
  378. Above all, have fun and good gaming to ya.  Any questions, drop me a line.
  379. Until 13 Dec 1993, I should be at:
  380.  
  381. Victor B. Putz
  382. 2102 W. Loop 289 #191
  383. Lubbock, TX 79407-1775
  384.  
  385. Or send it to my parents; they'll have my current permanent address:
  386. YakWare c/o Victor B. Putz, Sr.
  387. 701 Bellevue Blvd. South
  388. Bellevue, NE 68005
  389.